<template>
  <div>
    <MdPreview class="mdpreview" :model-value="props.value" />
  </div>
</template>

<script setup lang="ts">
import { withDefaults, defineProps, onMounted } from 'vue'

import { MdPreview } from 'md-editor-v3'
// import 'md-editor-v3/lib/style.css'
import 'md-editor-v3/lib/preview.css';

/**
 * 定义组件属性类型
 */
interface Props {
  value: string
}
let emit = defineEmits(['update:value', 'update:value', 'update'])
/**
 * 给组件指定初始值
 */
const props = withDefaults(defineProps<Props>(), {
  value: '',
})

onMounted(() => {
  console.log("==========MdPreview开始渲染==========")
  console.log(props.value)
})
</script>

<style scoped lang="scss">
.mdpreview{
  height: 100%;
}
</style>
